﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using __ts.Core.Service;
using __ts.Core.Transport.Tcp;
using __ts.Core.Transport.Tcp.Nio;
using __ts.Core.Filter.Logging;
using System.Net;
using System.IO;
using System.Threading;
using __ts.Core.Util;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            //OneThreadSelectorStrategy strategy = new OneThreadSelectorStrategy(
            //    new SelectorFactory(typeof(NioSelectorProcessor))
            //);

            //NioTcpServer acceptor = new NioTcpServer(strategy);

            //acceptor.setFilters(new LoggingFilter("LoggingFilter1"));
            //acceptor.addListener(new MyServiceListener());

            //try
            //{
            //    SocketAddress address = new SocketAddress(System.Net.Sockets.AddressFamily.InterNetwork, 9999);
            //    acceptor.bind(address);
            //    Console.WriteLine("Running the server for 25 sec");
            //    Thread.Sleep(25000);
            //    Console.WriteLine("Unbinding the TCP port");
            //    acceptor.unbind(address);
            //}
            //catch (IOException e)
            //{
            //    Console.WriteLine("I/O exception", e);
            //}
            //catch (Exception e)
            //{
            //    Console.WriteLine("Interrupted exception", e);
            //}

 

            Console.ReadKey();


        }



    }
}
